<%--
  Created by IntelliJ IDEA.
  User: WJ
  Date: 2017/12/12
  Time: 15:20
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page isELIgnored="false" %>
<html>
<head>
    <title>Attendance Result</title>
    <script src="js/jquery-3.2.1.min.js"></script>
</head>
<body>
<h2>人员信息录入成功</h2>
<button id="findAllEmp">查询所有员工信息</button>
<div id="content">
    <table id="empAll" border="1"cellspacing="0">

    </table>
</div>
<a href="homepage">返回</a>
</div>
</body>
<script>
    $("#findAllEmp").click(function(){
        $.get("findAllEmp",function(result){
            console.log(result);
            $("#empAll").html("");
            alert('ceshi')
            $("#empAll").html("<tr><td>数字</td><td>姓名</td><td>年龄</td><td>工号</td><td>入职日期</td><td>离职日期</td></tr>");
            for(var i=0;i<result.length;i++){
                var tr = $("<tr></tr>");
                var td = $("<td>"+ i +"</td><td>"
                    +result[i].name+ "</td><td>"
                    +result[i].age+"</td><td>"
                    +result[i].workNum+"</td><td>"
                    +result[i].entryDate+"</td><td>"
                    +result[i].departureDate+"</td>");
                tr.append(td);
                $("#empAll").append(tr);
            }
        })
    })
</script>
</html>
